//
//  PicDeViewController.m
//  Angel
//
//  Created by 梧桐树 on 16/4/26.
//  Copyright © 2016年 梧桐树. All rights reserved.
//

#import "PicDeViewController.h"

@interface PicDeViewController ()

@end

@implementation PicDeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
  
    image=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT)];
    image.image=self.photo;
//    if (_imageUrl.length==0) {
//        image.image=[UIImage imageNamed:@"外1.png"];
//    }else{
//        
//        [image sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",WEB,_imageUrl]] placeholderImage:[UIImage imageNamed:@"外1.png"]];
        image.frame=CGRectMake(0, 0, image.image.size.width, image.image.size.height);
//       // scr.contentSize=image.frame.size;
//        
//    }

    
    
    scr.contentSize=image.frame.size;
    [scr addSubview:image];
    
         //设置最大伸缩比例
         scr.maximumZoomScale=2.0;
         //设置最小伸缩比例
         scr.minimumZoomScale=0.5;
    //返回按键颜色
    [self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
    //返回按键图标
    [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60)
                                                         forBarMetrics:UIBarMetricsDefault];

   
}
//-(void)leftAction:(UIButton *)sender{
//    
//    [self.navigationController popViewControllerAnimated:YES];
//    
//}
//告诉scrollview要缩放的是哪个子控件
 -(UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
 {
         return image;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
